import request from '@/utils/request'

// 员工
export function fetchList(query) {
  return request({
    url: '/admin/admins',
    method: 'get',
    params: query
  })
}

export function fetchInfo(id) {
  return request({
    url: `/admin/admins/${id}`,
    method: 'get'
  })
}

export function fetchAdd(data) {
  return request({
    url: `/admin/admins`,
    method: 'post',
    data
  })
}

export function fetchEdit({ id, ...data }) {
  return request({
    url: `/admin/admins/${id}`,
    method: 'put',
    data
  })
}

export function fetchDelete(id) {
  return request({
    url: `/admin/admins/${id}`,
    method: 'delete'
  })
}

export function fetchReset(id) {
  return request({
    url: `admin/admins/${id}/reset`,
    method: 'put'
  })
}

